package com.ui;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

class Country{
	private String country;
	private String state;
	private String city;
	 Map<String, String> countryMap;
	 Map<String, String> stateMap;
	 List<String> cityList;
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public Map<String, String> getCountryMap() {
		return countryMap;
	}
	public void setCountryMap(Map<String, String> countryMap) {
		this.countryMap = countryMap;
	}
	public Map<String, String> getStateMap() {
		return stateMap;
	}
	public void setStateMap(Map<String, String> stateMap) {
		this.stateMap = stateMap;
	}
	public List<String> getCityList() {
		return cityList;
	}
	public void setCityList(List<String> cityList) {
		this.cityList = cityList;
	}
	public  void getCountryStateCity(){
		countryMap=new HashMap<String, String>();
		countryMap.put("1", "USA");
		countryMap.put("2", "India");
		if(country!=null && country.equalsIgnoreCase("1")){
			stateMap.put("1", "New York");
			stateMap.put("2", "Florida");
		}else if(country!=null && country.equalsIgnoreCase("2")){
			stateMap.put("1", "Bihar");
			stateMap.put("2", "Karnataka");
		}
		cityList=new ArrayList<String>();
		if(country!=null && country.equalsIgnoreCase("1") && state!=null && state.equalsIgnoreCase("1")){
			cityList.add("Ney York City 1");
			cityList.add("New York City 2");
		}else if(country!=null && country.equalsIgnoreCase("2") && state!=null && state.equalsIgnoreCase("2")){
			cityList.add("Patna");
			cityList.add("Bangalore");
		}
		
		for(Map.Entry entry: countryMap.entrySet()){
			System.out.println(entry.getKey()+"\t"+entry.getValue());
		}

	}
	
}
public class DropDownList {
public static void main(String[] args) throws Exception{
	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	Country c1=null;
	System.out.println("Enter your choice : ");
	String choice=br.readLine();
	switch (choice) {
	case "1":
		if(c1!=null){
			c1.getCountryStateCity();
		}
		
		break;

	default:
		break;
	}
}
}
